<template>
	<!-- 
http://youku.syhy000.com/wjl/#/?a=666666
-->
	<view class="main-box">
		<image @click="toTopMethod" class="bg" mode="widthFix" :src="rootImagePath+'t.png'"
			style="pointer-events: none">
		</image>

	<view class="" style="margin-top: -40rpx;">
		<ng-wx-ms :param="props.param" :autoSubmit="autoSubmit" :mobile="props.mobile"
			:rootImagePath="rootImagePath"></ng-wx-ms>
	</view>
	<view class="tip" style="margin-top: 30rpx;">
			南瓜电影APP会员连续包月联合产品
	</view>
	<view class="tip">
		 业务资费:首周免费，次周起自动扣费30元/月(可随时取消) 
	</view>
<view class="tip">
	客服热线：400-8825-101
</view>
	</view>
	
	<goto-form-fix-btn :targetId="scrollToTargetId" :rootImagePath="rootImagePath"></goto-form-fix-btn>
	<ng-right :rootImagePath="rootImagePath"></ng-right>
</template>

<script setup>
	import VueScrollTo from "vue-scrollto"
	import {
		onMounted,
		ref
	} from "vue";
	import httpUtil from "@/utils/httpUtil.js"
	import deviceUtil from "@/utils/deviceUtil.js"
	import userApi from "@/apis/userApi.js"
	import aliApi from "@/apis/aliApi";
	import commonApi from "@/apis/commonApi.js"
	import md5 from "@/utils/md5.js"
	import validParamsUtil from "@/utils/validParamsUtil";
	import logApi from "@/apis/logApi";
	import paramApi from "@/apis/paramApi.js"

		const rootImagePath = "https://web.78keji.cn/images/ngwx/ms/"

	const scrollToTargetId = ref('form-box')
	const scrollData = ref(0);

	const props = defineProps(['a', 'param', 'code', 'openid',
		'from_wxpay', 'openidHF', 'mobile', 'autoSubmit',
		'push_id', 'pushid', 'clickid', 'tokenid', 'adId', 'jtcAdRequestId',
		'qcjParamStr'
	])

	onMounted(() => {

		
		initData()
	})

		const initData = () => {
			console.log(window.location.href)
			var s = [];
			var hexDigits = "0123456789abcdef";
			for (var i = 0; i < 36; i++) {
				s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
			}
			s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
			s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
			s[8] = s[13] = s[18] = s[23] = "-";
			
			var uuid = s.join("");
			uni.setStorageSync('uuid', uuid)
			paramApi.clearParam()
			paramApi.initData(props)
			let params = {
				a: httpUtil.getA(),
				proCode: 'LH2528',
				uuid:uni.getStorageSync('uuid')
			}
			httpUtil.post('/api/tongji/tongji0520', params, res => {


			})
			commonApi.is404()

			// #ifdef H5

			if (deviceUtil.isWeChatBrowser()) {
				// 用户没有userId 就获取
				if (!userApi.getUserId() && !props.code) {
					userApi.gotoH5WxPlatformLoginUrl()
				}
				if (!userApi.getUserId() && props.code) {
					userApi.initUserId(props.code)
				}
				// 支付宝浏览器登录
			} else if (deviceUtil.isAliBrowser() && !userApi.getUserId()) {
				aliApi.getAliUserIdMethod()
			}

			// #endif
			// #ifdef MP
			initMiniData()
			// #endif
			// checkOrderStatus()
			commonApi.buriedPoint()
		}




	const initMiniData = () => {
		userApi.getMiniLoginCode(code => {
			userApi.initUserId(code)
		})
	}
	const scrollTopMethod = () => {
		scrollData.value = document.documentElement.scrollTop || document.body.scrollTop;
	}

	const toTopMethod = () => {
		console.log('toTopMethod', scrollToTargetId.value)
		let offset = document.documentElement.clientHeight / 2 - 100;
		VueScrollTo.scrollTo(document.getElementById(scrollToTargetId.value), 1000, {
			offset: -offset,
		});
	}

	const gotoReceive = () => {
		window.location.href =
			'https://shop118429696.m.youzan.com/v2/feature/aUVgJC8JZb?shopAutoEnter=1&kdt_id=118237528'
	}
</script>

<style lang="scss">
	.main-box {
		position: relative;
	height: 100%;
		background-color: #ffebeb;

	}

	.bg {
		width: 100%;
		display: block;
	}

	.tip{
		

		font-weight: 800;
		font-size: 20rpx;
		color: #000000;
		line-height: 26rpx;
		text-align: center;
	}
</style>